Skip to content

Do not display command usage help after execution is started #4229

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

Closed
vtrifonov opened this issue Dec 13, 2018 · 1 comment
Closed

Do not display command usage help after execution is started #4229

vtrifonov opened this issue Dec 13, 2018 · 1 comment
Assignees
Milestone

Comments

@vtrifonov
Copy link
Contributor

Is your feature request related to a problem? Please describe.
In my opinion the command usage description should be shown only when wrong arguments are passed to a command, otherwise showing the description after tns deploy for example fails is not helpful, it just makes me scroll to see the error above that description

Describe the solution you'd like
The command description should be shown only if you've passed wrong arguments to a command and the command itself cannot start, otherwise if the command is started by fails afterwords the description shouldn't be shown

Additional context
Here's an example log from the tns deploy ios --release --for-device command:

...
Project successfully built.
Installing on device 00009120-00046DEA0288112E...
Failed to install /Users/trifonov/Work/ns-playground-apps/ns-play-dev/platforms/ios/build/device/nsplaydev.ipa on device with identifier 00009120-00046DEA0288112E. Error is: Could not install application
# tns deploy

### Description

Prepares, builds and deploys the project to a connected device or native emulator. You must specify the target platform on which you want to deploy. It will deploy the app on all connected devices targeting the selected platform.

IMPORTANT: Before building for iOS device, verify that you have configured a valid pair of certificate and provisioning profile on your macOS system.

### Commands

┌───────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Usage             │ Synopsis                                                                                                                                                                              │
│ Deploy on Android │ $ tns deploy android [--device <Device ID>] [--key-store-path <File Path> --key-store-password <Password> --key-store-alias <Name> --key-store-alias-password <Password>] [--release] │
│ Deploy on iOS     │ $ tns deploy ios [--device <Device ID>] [--release]                                                                                                                                   │
└───────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

### Options for iOS

    * --device - Deploys the project on the specified connected physical or virtual device. <Device ID> is the index or name of the target device as listed by the $ tns devices command.
    * --release - If set, produces a release build. Otherwise, produces a debug build.

### Options for Android

    * --device - Deploys the project on the specified connected physical or virtual device. <Device ID> is the index or name of the target device as listed by the $ tns devices command.
    * --clean - If set, forces the complete rebuild of the native application.
    * --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options.
    * --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.

In the example above I don't need the tns deploy command usage description at all.

@DimitarTachev DimitarTachev self-assigned this Jul 22, 2019
@DimitarTachev DimitarTachev added this to the 6.0.3 milestone Jul 22, 2019
@DimitarTachev
Copy link
Contributor

DimitarTachev commented Aug 8, 2019

Acceptance criteria:

  • The help should be printed only when requested with tns help or tns <command> --help
  • A hint referring the command help should be printed when there is a syntax error with the command. E.g. invalid argument, invalid options, invalid command name, invalid argument/option value, invalid sub-command like tns run windows.
  • When a command execution is started but it fails, we shouldn't print anything after the exceptions/errors.
  • All syntax error messages should be colored in red.
  • The hint referring the command help should be colored in yellow and unified in all cases.

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

No branches or pull requests

4 participants