dbt-core icon indicating copy to clipboard operation
dbt-core copied to clipboard

[CT-1204] [Feature] Add shorthand for `--full-refresh` flag

Open dave-connors-3 opened this issue 2 years ago • 10 comments

Is this your first time submitting a feature request?

  • [X] I have read the expectations for open source contributors
  • [X] I have searched the existing issues, and I could not find an existing issue for this feature
  • [X] I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

I write (and misspell!) --full-refresh a whole heck of a lot during dbt development. Would love to add a shorthand for that flag in the sameway that --select can be reduced to -s, --target can be reduced to -t etc.

Describe alternatives you've considered

Keeping on keeping on! There's a tradeoff here between clarity and brevity, so i understand we probably don't want to make every single flag shorthand!

Who will this benefit?

keyboard users

Are you interested in contributing this feature?

Yes!

Anything else?

No response

dave-connors-3 avatar Sep 19 '22 16:09 dave-connors-3

I like it...perhaps we can tackle in the click work for 1.4? @iknox-fa how easy would this be? should we wait, or do this now?

lostmygithubaccount avatar Sep 19 '22 18:09 lostmygithubaccount

I thought that shorthand params needed to be 1 char so we could chain them together, e.g. dbt -x -q run is the same as doing dbt -xq run(and it is the same behavior for most CLI tools, like ls -la being the same as ls -l -a).

Did we check what happens now that we have a shorthand param with 2 chars?

b-per avatar Sep 22 '22 13:09 b-per

@b-per Whoa, I didn't know about that! It isn't something I checked (or thought about) when we were deciding between -fr and a single-character version (-f).

Links I quickly found:

  • https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
  • https://stackoverflow.com/questions/67145068/does-click-support-bunching-short-options-together (click is our new in-development CLI, replacing the current one based on argparse)

Each option name should be a single alphanumeric character (the alnum character classification) from the portable character set.

If there's a lot of additional utility in doing this, we could swap to the single char version (-f)

jtcohen6 avatar Sep 22 '22 13:09 jtcohen6

whoa who knew! Definitely open to changing it! I have never chained flags together as i'm sure you can tell

dave-connors-3 avatar Sep 22 '22 13:09 dave-connors-3

This is another link mentioning that from the POSIX standpoint short params should be 1 char. Not sure if we are forcing ourselves to be POSIX compliant though.

I thing that -f is a pretty good candidate instead of -fr.

b-per avatar Sep 22 '22 13:09 b-per

Despite my love for the very memeable -fr, I am convinced

dave-connors-3 avatar Sep 22 '22 13:09 dave-connors-3

may the -f be with you both!

wanna PR it up? (and edit the description here: https://github.com/dbt-labs/docs.getdbt.com/issues/2055)?

jtcohen6 avatar Sep 22 '22 13:09 jtcohen6

on it!

dave-connors-3 avatar Sep 22 '22 13:09 dave-connors-3

@b-per -- out of curiousity, if i was going to chain flags together that require arguments (like -t or -s, so the args just follow the order of the flags as you combine them?

i.e.

$ dbt build -s i_miss_fr -t postgres
$ dbt build -st i_miss_fr postgres

are the same?

dave-connors-3 avatar Sep 22 '22 13:09 dave-connors-3

I believe that chaining short parameters is only supported for those that don't require any value. So build -xf works but to add a selector it will be build -xf -s my_model.

b-per avatar Sep 22 '22 14:09 b-per