Skip to content

Commit

Permalink
Misc cli fixes (#396)
Browse files Browse the repository at this point in the history
* fix: fixed CLI help text, removed unneeded arg in wick config expand, fixed *nix wick install

* refactor: moved warn events to debug
  • Loading branch information
jsoverson authored Aug 4, 2023
1 parent 7968fb0 commit 3c80d28
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion crates/bins/wick/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dialoguer = { workspace = true, features = ["password"] }
human-panic = { workspace = true }
futures = { workspace = true }
thiserror = { workspace = true }
clap = { workspace = true, features = ["derive", "std"] }
clap = { workspace = true, default-features = true, features = ["derive"] }
nkeys = { workspace = true }
atty = { workspace = true }
jaq-core = { workspace = true, features = ["serde_json"] }
Expand Down
4 changes: 0 additions & 4 deletions crates/bins/wick/src/commands/config/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ pub(crate) struct Options {
#[clap(action)]
pub(crate) path: String,

/// Operation to render.
#[clap(action)]
pub(crate) operation: String,

#[clap(flatten)]
pub(crate) oci: crate::oci::Options,

Expand Down
4 changes: 2 additions & 2 deletions crates/bins/wick/src/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ esac
app_path="{}"
if [ -x "$basedir/wick" ]; then
exec "$basedir/wick" "run" "$app_path" "$@"
exec "$basedir/wick" "run" "$app_path" "--" "$@"
else
exec wick "run" "$app_path" "$@"
exec wick "run" "$app_path" "--" "$@"
fi
"#,
target
Expand Down
6 changes: 1 addition & 5 deletions crates/bins/wick/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@ async fn async_start() -> Result<(GlobalOptions, StructuredOutput), (GlobalOptio
panic::setup(human_panic::PanicStyle::Human);

let mut args = std::env::args().collect::<Vec<_>>();
// first arg is always the command name, so get the first argument after.
if let Some(first) = args.get(1) {
// If the first real argument contains a dot or any slash, make the default subcommand `wick run`
if first.contains('.') || first.contains('/') || first.contains('\\') {}
}

let matches = <Cli as clap::CommandFactory>::command().try_get_matches_from(&args);
if let Err(e) = matches {
Expand All @@ -201,6 +196,7 @@ async fn async_start() -> Result<(GlobalOptions, StructuredOutput), (GlobalOptio
}
}
}

let mut cli = Cli::parse_from(args);
let options = cli.output.clone();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl Transaction {
} else if packet.is_noop() {
// TODO: propagate this and/or its context if it becomes an issue.
} else {
warn!(port = packet.port(), "dropping packet for unconnected port");
debug!(port = packet.port(), "dropping packet for unconnected port");
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl Validator {
let mut walker = SchematicWalker::from_port(schematic, port.detached(), WalkDirection::Down);
let next = walker.nth(1);
if next.is_none() {
warn!(id=node.name.clone(), operation = %reference, port = %field.name, "unhandled downstream connection");
debug!(id=node.name.clone(), operation = %reference, port = %field.name, "unhandled downstream connection");
// validation_errors.push(ValidationError::UnusedOutput {
// port: field.name.clone(),
// id: node.name.clone(),
Expand Down

0 comments on commit 3c80d28

Please sign in to comment.