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

Improve scripting UI #34

Open
crispinb opened this issue Feb 25, 2023 · 1 comment
Open

Improve scripting UI #34

crispinb opened this issue Feb 25, 2023 · 1 comment
Labels
enhancement New feature or request pending-multicap Plan now is for a general capture tool. Task is on hold until that plan is formed

Comments

@crispinb
Copy link
Owner

crispinb commented Feb 25, 2023

There are really 3 types of UIs for terminal use:

  1. the classic cli, with all necessary data supplied as flags, for one-shot interactionless use
  2. interactive, prompting the user linewise for missing info (eg. npm create ...)
  3. tui

cvcap currently is an awkward blend of cli/interactive - mostly interactive but sort-of cli with the -q flag. Currently however this mode just fails when info is missing (eg there's no defualt list), with no capacity to provide the missing data as part of the invocation.

The standard approach to dealing with cli vs interactive is to blend them, using an ever more complex combination of flags - eg -y to skip prompts. But which prompts? This could be sorted out with positional -ys or some other complex combination of flags.

But I wonder if it might be simpler (and less tied to posix/unix) to just keep the two cases separate.

-q (or maybe something like --noninteractive to make it triply clear) can flick cvcap into a different mode, where all data must be provided to avoid a nonzero exit. To make this even clearer, and avoid having to mess more than I want to with clap, my current thought is for that data to be provided en bloc in a structure. Inline JSON perhaps, or perhaps search for a way that needs less "-escaping (does this even matter for scripting/programmatic use?)

@crispinb crispinb added the enhancement New feature or request label Feb 25, 2023
@crispinb crispinb changed the title Replace -q with a scriping-specific UI Replace -q with a scripting-specific UI Feb 25, 2023
@crispinb
Copy link
Owner Author

crispinb commented Feb 26, 2023

see https://clig.dev/#interactivity for standard guidelines, notably:

  • check stdin is a tty for interactivity
  • offer a --no-input option to suppress interactivity
  • use -q

What's the case for --no-input without -q?

@crispinb crispinb changed the title Replace -q with a scripting-specific UI Improve scripting UI Feb 26, 2023
@crispinb crispinb added the pending-multicap Plan now is for a general capture tool. Task is on hold until that plan is formed label Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pending-multicap Plan now is for a general capture tool. Task is on hold until that plan is formed
Projects
None yet
Development

No branches or pull requests

1 participant