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

CLI design for diffing commands #495

Open
merijn opened this issue Mar 11, 2021 · 0 comments
Open

CLI design for diffing commands #495

merijn opened this issue Mar 11, 2021 · 0 comments

Comments

@merijn
Copy link
Contributor

merijn commented Mar 11, 2021

I'm finally polishing up the config diffing code I wrote in December, which would simplify comparing one generated CI config with another. The CLI UX for this is a bit tricky, though. There's a number of comparisons that make sense:

  • Comparing a config file against the default config
  • Comparing a Travis/GitHub/bash file against the default config
  • Comparing 2 config files
  • Comparing 2 CI files against each other
  • Comparing a CI file against a config file

The "obvious" UX is diff with 1 argument compares against the default config and with 2 arguments it diffs those two files. There are two tricky UX parts:

  • What would it mean if there are commandline options passed to the diff command
  • How do we know if a file is a config file?

The first issue can be trivially solved by refactoring some of the optparse code in HaskellCI.Cli to move the flags/options into the subcommands and simply disallowing commandline options to a diff subcommand. Becomes somewhat more challenging with the future goal of eliminating subcommands.

The second issue is trickier. CI files are easy to detect since they always use REGENDATA, which already has extraction code. But how to detect whether something is a config file? Do we simply assume a lack of REGENDATA means something is a haskell-ci config file?

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

No branches or pull requests

1 participant