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

dhall: provide flag -o, --output for writing to file #1386

Closed
DrSensor opened this issue Oct 4, 2019 · 4 comments
Closed

dhall: provide flag -o, --output for writing to file #1386

DrSensor opened this issue Oct 4, 2019 · 4 comments

Comments

@DrSensor
Copy link

DrSensor commented Oct 4, 2019

Related to #1303, I think --output flag is missing for dhall cli

$ dhall --version
1.26.1

$ dhall --help
Usage: dhall ([version] | [resolve] | [type] | [normalize] | [repl] | [diff] |
             [hash] | [lint] | [format] | [freeze] | [encode] | [decode] |
             [text] | [--file FILE] [--annotate] [--alpha] [--no-cache]
             [--version]) [--explain] [--plain] [--ascii] [--censor]
  Interpreter for the Dhall language

Available options:
  -h,--help                Show this help text
  --file FILE              Read expression from a file instead of standard input
  --annotate               Add a type annotation to the output
  --alpha                  α-normalize expression
  --no-cache               Handle protected imports as if the cache was empty
  --version                Display version
  --explain                Explain error messages in more detail
  --plain                  Disable syntax highlighting
  --ascii                  Format code using only ASCII syntax
  --censor                 Hide source code in error messages

Available commands:
  version                  Display version
  resolve                  Resolve an expression's imports
  type                     Infer an expression's type
  normalize                Normalize an expression
  repl                     Interpret expressions in a REPL
  diff                     Render the difference between the normal form of two
                           expressions
  hash                     Compute semantic hashes for Dhall expressions
  lint                     Improve Dhall code by using newer language features
                           and removing dead code
  format                   Standard code formatter for the Dhall language
  freeze                   Add integrity checks to remote import statements of
                           an expression
  encode                   Encode a Dhall expression to binary
  decode                   Decode a Dhall expression from binary
  text                     Render a Dhall expression that evaluates to a Text
                           literal
@sjakobi
Copy link
Collaborator

sjakobi commented Oct 4, 2019

Seems reasonable. I think this should be fairly easy to implement in analogy to #1304.

The main entry point for the CLI is here:

-- | Entry point for the @dhall@ executable
main :: IO ()
main = do
options <- Options.Applicative.execParser parserInfoOptions
command options

The options for the default command (dhall) are defined here:

= Default
{ file :: Input
, annotate :: Bool
, alpha :: Bool
, semanticCacheMode :: SemanticCacheMode
, version :: Bool
}

@Rizary
Copy link
Contributor

Rizary commented Oct 5, 2019

@sjakobi If no one working on this yet, I'll try it.

@sjakobi
Copy link
Collaborator

sjakobi commented Oct 5, 2019

@Rizary Great! :)

If any questions come up, feel free to ask right here!

@sjakobi
Copy link
Collaborator

sjakobi commented Oct 7, 2019

#1399 fixed this. Thanks @Rizary! :)

@sjakobi sjakobi closed this as completed Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants