Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ssm --help command #457

Merged
merged 1 commit into from
Jan 7, 2025
Merged

fix ssm --help command #457

merged 1 commit into from
Jan 7, 2025

Conversation

johnduffell
Copy link
Member

@johnduffell johnduffell commented Jan 7, 2025

This PR fixes the ssm --help command.

The default mode has changed to -x for most cases (see #375 ). However this only makes sense in some cases and not when you use --help.

This PR adds it so that --help is also excluded from the auto-execute behaviour.

Before (broken)

% ssm --help                
bash: Usage:: command not found
bash: repl: command not found
bash: args: No such file or directory
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address]
           [-c cipher_spec] [-D [bind_address:]port] [-E log_file]
           [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file]
           [-J destination] [-L address] [-l login_name] [-m mac_spec]
           [-O ctl_cmd] [-o option] [-P tag] [-p port] [-R address]
           [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
           destination [command [argument ...]]
       ssh [-Q query_option]
bash: line 2: --help: command not found
bash: line 3: value: No such file or directory
bash: -c: line 4: syntax error near unexpected token `('
bash: -c: line 4: `  -i, --instances <value>  Specify the instance ID(s) on which the specified command(s) should execute'

however if I do ssm --raw --help it seems ok

% ssm --raw --help
Error: Unknown option --raw
Usage: ssm [cmd|repl|ssh|scp] [options] <args>...

  --help                   prints this usage text
..........etc............

Afterwards we don't need the --raw (in DEV)

 % target/scala-3.3.4/ssm --help
Usage: ssm [cmd|repl|ssh|scp] [options] <args>...

  --help                   prints this usage text
  -p, --profile <value>    The AWS profile name to use for authenticating this execution
 ......etc.....

I have checked and we can still log in to a machine without -x

Copy link
Contributor

@adamnfish adamnfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

If you get this merged I can do a release tomorrow - need to roll out a few dependency bumps anyway.

Thank you!

@johnduffell johnduffell merged commit 20416a8 into main Jan 7, 2025
1 check passed
@johnduffell johnduffell deleted the jd-fix-help branch January 7, 2025 17:17
@mchv
Copy link
Member

mchv commented Jan 7, 2025

Nice one @johnduffell

@philmcmahon
Copy link
Contributor

philmcmahon commented Jan 8, 2025

Thank you for fixing this @johnduffell !! (And sorry for the mess I created!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants