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

Hide examples section of forc help message, only show them with a flag #6005

Closed
kayagokalp opened this issue May 14, 2024 · 1 comment · Fixed by #6013
Closed

Hide examples section of forc help message, only show them with a flag #6005

kayagokalp opened this issue May 14, 2024 · 1 comment · Fixed by #6013
Assignees
Labels
enhancement New feature or request forc good first issue Good for newcomers

Comments

@kayagokalp
Copy link
Member

Currently the forc default output is huge, not nice to view in smaller screens. I think we should have the examples section under --examples type of flag rather than showing them by default

Current output:

Fuel Orchestrator

Usage: forc [OPTIONS] <COMMAND>

Commands:
  addr2line       Show location and context of an opcode address in its source file
  build           Compile the current or target project [aliases: b]
  check           Check the current or target project and all of its dependencies for errors
  clean           Removes the default forc compiler output artifact directory, i.e. `<project-name>/out`
  completions     Generate tab-completion scripts for your shell
  new             Create a new Forc project at `<path>`
  init            Create a new Forc project in an existing directory
  parse-bytecode  Parse bytecode file into a debug format
  test            Run the Sway unit tests for the current project [aliases: t]
  update          Update dependencies in the Forc dependencies directory
  plugins         List all forc plugins
  template        Create a new Forc project from a git template
  contract-id     Determine contract-id for a contract. For workspaces outputs all contract ids in the workspace
  predicate-root  Determine predicate-root for a predicate. For workspaces outputs all predicate roots in the workspace
  help            Print this message or the help of the given subcommand(s)

Options:
  -v, --verbose...             Use verbose output
  -s, --silent                 Silence all output
  -L, --log-level <LOG_LEVEL>  Set the log level
  -h, --help                   Print help
  -V, --version                Print version

Examples:
    # List all plugins
    forc plugins

    # List all plugins with their paths
    forc plugins --paths

    # List all plugins with their descriptions
    forc plugins --describe

    # List all plugins with their paths and descriptions
    forc plugins --paths --describe

    # Run test
    forc test

    # Run test with a filter
    forc test $filter

    # Run test without any output
    forc test --silent

    # Run test without creating or update the lock file
    forc test --locked

    # Compile the current projectx
    forc build

    # Compile the current project from a different path
    forc build --path <PATH>

    # Compile the current project without updating dependencies
    forc build --path <PATH> --locked

    # Check the current project
    forc check

    # Check the current project with a different path
    forc check --path <PATH>

    # Check the current project without updating dependencies
    forc check --locked
@kayagokalp kayagokalp added enhancement New feature or request good first issue Good for newcomers forc labels May 14, 2024
@kayagokalp
Copy link
Member Author

cc @FuelLabs/tooling

@kayagokalp kayagokalp changed the title Hide examples section of forc help message under a --help Hide examples section of forc help message, only show them with a flag May 14, 2024
@kayagokalp kayagokalp self-assigned this May 15, 2024
kayagokalp added a commit that referenced this issue May 15, 2024
## Description
closes #6005.

As stated in the issue, executing `forc` prints huge output with
examples etc. This is not ideal because it is very hard to navigate to
list of commands especially with smaller screens. This PR changes the
behavor such that executing just `forc` will print:

```console
Fuel Orchestrator

Usage: forc [OPTIONS] <COMMAND>

Commands:
  addr2line       Show location and context of an opcode address in its source file
  build           Compile the current or target project [aliases: b]
  check           Check the current or target project and all of its dependencies for errors
  clean           Removes the default forc compiler output artifact directory, i.e. `<project-name>/out`
  completions     Generate tab-completion scripts for your shell
  new             Create a new Forc project at `<path>`
  init            Create a new Forc project in an existing directory
  parse-bytecode  Parse bytecode file into a debug format
  test            Run the Sway unit tests for the current project [aliases: t]
  update          Update dependencies in the Forc dependencies directory
  plugins         List all forc plugins
  template        Create a new Forc project from a git template
  contract-id     Determine contract-id for a contract. For workspaces outputs all contract ids in the workspace
  predicate-root  Determine predicate-root for a predicate. For workspaces outputs all predicate roots in the workspace
  help            Print this message or the help of the given subcommand(s)

Options:
  -v, --verbose...             Use verbose output
  -s, --silent                 Silence all output
  -L, --log-level <LOG_LEVEL>  Set the log level
  -h, --help                   Print help (see more with '--help')
  -V, --version                Print version
```

with `--help` flag we still show the examples etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant