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

[components] Move global options to subcommands #26640

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smackesey
Copy link
Collaborator

@smackesey smackesey commented Dec 20, 2024

Summary & Motivation

This changes the options scheme in dagster-dg so that options are no longer hierarchically processed and passed down the command tree. Instead, all leaves of the tree have the same set of "global options" appended to their options list. These are visually separated in the help message. We correspondingly simplify the Usage message to have a single [OPTIONS] input spot.

Before:

$ dg generate component --help

Usage: dg [OPTIONS] generate component [OPTIONS] COMPONENT_TYPE COMPONENT_NAME [EXTRA_ARGS]...

  Generate a scaffold of a Dagster component.

  ... description ...

Options:
  --json-params TEXT  JSON string of component parameters.
  -h, --help          Show this message and exit.

Options (dg):
  --builtin-component-lib TEXT  Specify a builitin component library to use.
  --verbose                     Enable verbose output for debugging.
  --disable-cache               Disable caching of component registry data.
  --clear-cache                 Clear the cache before running the command.
  --cache-dir PATH              Specify a directory to use for the cache.

How I Tested These Changes

Modified unit tests, played with it on the command line.

@smackesey smackesey force-pushed the sean/components/switch-cli-order branch from 1623432 to 6904983 Compare December 20, 2024 17:51
@smackesey smackesey force-pushed the sean/components/move-global-options branch from d4e62c5 to 309a1a8 Compare December 20, 2024 17:51
Base automatically changed from sean/components/switch-cli-order to master December 20, 2024 17:51
@smackesey smackesey force-pushed the sean/components/move-global-options branch from 309a1a8 to 397e077 Compare December 20, 2024 20:17
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.

1 participant