feat: better convert usage
This commit is contained in:
@@ -25,11 +25,14 @@ func LambdaConvert() *cobra.Command {
|
||||
var inputReprFlag, outputReprFlag string
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "convert <input> <output>",
|
||||
Use: "convert <input-file> <output-file>",
|
||||
Short: "Convert between lambda calculus representations",
|
||||
Args: cobra.ExactArgs(2),
|
||||
SilenceUsage: true,
|
||||
RunE: func(_ *cobra.Command, args []string) error {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if len(args) != 2 {
|
||||
return cmd.Help()
|
||||
}
|
||||
|
||||
var err error
|
||||
inputPath, outputPath := args[0], args[1]
|
||||
|
||||
@@ -71,7 +74,7 @@ func LambdaConvert() *cobra.Command {
|
||||
// Marshal output.
|
||||
output, err := r.Marshal(result)
|
||||
if err != nil {
|
||||
return fmt.Errorf("marshaling output: %w", err)
|
||||
return fmt.Errorf("unmarshaling output: %w", err)
|
||||
}
|
||||
|
||||
// Write output file.
|
||||
|
||||
Reference in New Issue
Block a user