Skip to content

Commit

Permalink
Fix completion generation (#264)
Browse files Browse the repository at this point in the history
* Test completion/subcommand parsing in CI
* Fix completion/parsing errors on fp views create
  • Loading branch information
gagbo authored Dec 14, 2023
1 parent e03197a commit 3bccaf5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ jobs:
clippy_flags: --all-features --release

- name: Run tests
run: cargo test --release
run: cargo test --release --all

# Clap has specific debug asserts when generating completions
- name: Run Completion generation test
run: cargo test generating_completions --bin fp

- name: Generate manifest
run: target/release/fp version -o json > manifest.json
Expand Down
7 changes: 5 additions & 2 deletions src/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ struct CreateArguments {
description: Option<String>,

/// The color the resulting view should be displayed as in Fiberplane Studio
#[clap(value_parser = clap::value_parser!(i16).range(0..10))]
#[clap(long, value_parser = clap::value_parser!(i16).range(0..10))]
color: i16,

/// Labels which are associated with this newly created view
#[clap(long, short)]
labels: Vec<KeyValueArgument>,

/// Time range value in either seconds, minutes, hours or days (without suffix).
Expand All @@ -76,13 +77,15 @@ struct CreateArguments {
time_range_value: Option<i64>,

/// Time range unit. Used in conjunction with `time_range_value`
#[clap(requires = "time_range_value")]
#[clap(requires = "time_range_value", value_enum)]
time_range_unit: Option<TimeUnit>,

/// What the notebooks displayed in the view should be sorted by, by default
#[clap(value_enum)]
sort_by: Option<NotebookSortFields>,

/// Sort direction displayed by default when opening the view
#[clap(value_enum)]
sort_direction: Option<SortDirection>,

/// Workspace in which this view lives
Expand Down

0 comments on commit 3bccaf5

Please sign in to comment.