From 58d08230698f3166c84d177e3d2e32f2dd3236e4 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sat, 7 Feb 2026 04:31:57 +0000 Subject: [PATCH] feat: rename --from/--to flags to --input/--output (#42) ## Description The `convert` and `reduce` commands used `--from` and `--to` flags to specify input/output representations. These names are ambiguous and don't clearly describe what they control. This PR renames them to `--input`/`--output` and adds `-i`/`-o` short aliases for convenience. - Rename `--from` to `--input` (`-i`) in `convert` and `reduce` commands. - Rename `--to` to `--output` (`-o`) in the `convert` command. - Switch from `StringVar` to `StringVarP` to support the new short flags. ## Benefits - Flag names now clearly indicate they refer to representations, not file paths. - Short aliases `-i` and `-o` make CLI usage more concise. ## Checklist - [x] Code follows conventional commit format. - [x] Branch follows naming convention (`/`). Always use underscores. - [x] Tests pass (if applicable). - [ ] Documentation updated (if applicable). Reviewed-on: https://git.maximhutz.com/mvhutz/lambda/pulls/42 Co-authored-by: M.V. Hutz Co-committed-by: M.V. Hutz --- cmd/lambda/lambda_convert.go | 4 ++-- cmd/lambda/lambda_reduce.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/lambda/lambda_convert.go b/cmd/lambda/lambda_convert.go index bd7ad9e..b2fd20c 100644 --- a/cmd/lambda/lambda_convert.go +++ b/cmd/lambda/lambda_convert.go @@ -87,8 +87,8 @@ func LambdaConvert() *cobra.Command { }, } - cmd.Flags().StringVar(&inputReprFlag, "from", "", "Input representation (inferred from extension if unset)") - cmd.Flags().StringVar(&outputReprFlag, "to", "", "Output representation (inferred from extension if unset)") + cmd.Flags().StringVarP(&inputReprFlag, "input", "i", "", "Input representation (inferred from extension if unset)") + cmd.Flags().StringVarP(&outputReprFlag, "output", "o", "", "Output representation (inferred from extension if unset)") return cmd } diff --git a/cmd/lambda/lambda_reduce.go b/cmd/lambda/lambda_reduce.go index a6f1039..29684fa 100644 --- a/cmd/lambda/lambda_reduce.go +++ b/cmd/lambda/lambda_reduce.go @@ -102,7 +102,7 @@ func LambdaReduce() *cobra.Command { }, } - cmd.Flags().StringVar(&inputReprFlag, "from", "", "Input representation (inferred from extension if unset)") + cmd.Flags().StringVarP(&inputReprFlag, "input", "i", "", "Input representation (inferred from extension if unset)") cmd.Flags().StringVarP(&engineFlag, "engine", "e", "", "Reduction engine (inferred from '--input' if unset)") return cmd