cli changelogs | diffwithgpt
AI Summary
The code adds a 'completable' flag to a test command and updates the Fish completion logic to include hidden commands with this flag. The Fish completion function now includes hidden commands if they have the 'completable' flag set, which may affect how completions are displayed in the shell.
Commit Log
Fish completions for commands and flags inside hidden command.
AI Summary
The code removes the addition of help and version flags in Fish completion templates, likely to prevent redundant help commands from being generated. This change may affect the completeness of Fish completion by omitting help and version flags, which could lead to less informative completion suggestions.
Commit Log
Fish completions need not add their own help commands.
AI Summary
The code change simplifies context detection for Fish shell completions by focusing only on top-level commands, improving performance and reducing complexity. It also includes hidden top-level commands in the completion list, ensuring they are accessible to users.
Commit Log
Simpler top-level context detection for fish completions. Previously, completions checked against all levels of subcommands. This change has it look only for top-level commands, which must necessarily be present before their children. It also adds hidden top-level commands to the list.
AI Summary
The commit updates the documentation to use consistent spacing in the flag definition for the 'password' flag. This change is likely to improve readability and maintainability of the example documentation.
Commit Log
Update docs/v3/examples/flags/value-sources.md
AI Summary
The commit updates the documentation to correct formatting in the flag definition for the 'password' flag. The changes ensure consistency in the markdown formatting of the example, improving readability and maintainability.
Commit Log
Update docs/v3/examples/flags/value-sources.md
AI Summary
The code updates a documentation example to use more explicit field names in a flag definition. This change likely improves readability and maintainability of the example for users.
Commit Log
Update docs/v3/examples/flags/value-sources.md
AI Summary
The commit adds documentation for renaming key components in the v3 migration of the cli package, such as App to Command and related fields. It provides code examples for v2 and v3 syntax to help users transition between versions, highlighting changes like EnableBashCompletion to EnableShellCompletion.
Commit Log
docs: add renames to v3 migration doc
AI Summary
The commit removes documentation about the `Float64` type and its usage in migrating from cli/v2 to cli/v3. This change likely reflects the deprecation or removal of `Float64` in favor of `Float` in the newer version of the cli package.
Commit Log
docs: remove section about `Float64`
AI Summary
The code change updates documentation to reflect the migration from `cli.Float64Flag` and `cli.Context.Float64` to `cli.FloatFlag` and `cli.Command.Float` in version 3 of the cli package. This change is part of the migration guide to help developers update their code from version 2 to version 3 of the cli library.
Commit Log
docs: add `Float64` -> `Float`
AI Summary
The commit updates documentation to use consistent formatting for type placeholders in examples, improving clarity and consistency. It also adds a markdown link to the package documentation for better navigation and reference.
Commit Log
Cleanup docs
AI Summary
The code change modifies the Fish shell command completion logic to use '-x' instead of '-r' in the 'complete' command, which likely prevents suggesting subcommands in certain contexts. This change is likely aimed at improving the accuracy of command suggestions by avoiding unnecessary subcommand recommendations, especially in cases where the user is not in a subcommand context.
Commit Log
Avoid suggesting files in fish command completions.
AI Summary
The code adds documentation for advanced value sources in the CLI library, explaining how to use the altsrc package to load flag values from external files like YAML, JSON, or TOML. It provides an example of how to bind a flag's value to a source using the altsrc package, allowing for dynamic loading of configuration data.
Commit Log
Add docs for advanced value source
AI Summary
The code change modifies the fishSubcommandHelper function to include a list of sibling commands to avoid suggesting subcommands that have already been picked. This ensures that the Fish shell completion does not show subcommands that are already part of the current command chain, improving user experience and preventing confusion.
Commit Log
Avoid suggesting subcommands that have already been picked.
AI Summary
The commit adds documentation for customizing shell completions in the CLI library, including examples of custom auto-completion and command customization. It also updates the navigation in the documentation to include the new customizations section.
Commit Log
Cleanup docs
AI Summary
The code adds a new function type `ConfigureShellCompletionCommand` to the `Command` struct for configuring shell completion commands. This change is likely to support shell completion features in the CLI tool, enhancing user experience by allowing command-line tab completion.
Commit Log
docs: make v3approve
AI Summary
The code adds a new function type `ConfigureShellCompletionCommand` to the `Command` struct for configuring shell completion commands. This change enables shell completion support for commands in the CLI tool, improving user experience by allowing tab completion.
Commit Log
docs: make generate
AI Summary
The code change adds a JSON tag to a field in the Command struct to suppress JSON serialization. This is likely done to fix a lint error related to unused fields or to prevent the field from being included in JSON output.
Commit Log
fix: fix a lint error
AI Summary
The commit updates documentation to reflect a change in how completion commands are customized, replacing the deprecated `BuildCompletionCommand` with `ConfigureShellCompletionCommand`. The `BuildCompletionCommand` function has been removed from the public API, and the documentation now shows how to customize completion commands using the `ConfigureShellCompletionCommand` method.
Commit Log
docs: update godoc and the document
AI Summary
The code adds a new feature to configure shell completion commands in the CLI tool, allowing customizations via a function. The change modifies the logic for building completion commands to include a new optional configuration function.
Commit Log
feat: add ConfigureShellCompletionCommand
AI Summary
The code fixes a typo in the documentation by changing 'Float32Flag' to 'Float64Flag' in multiple locations. This change ensures consistency between the function's name and the type it references, improving clarity and correctness.
Commit Log
docs: fix typos
AI Summary
The code refactors multiple slice flag functions to use a unified getNumberSlice function, reducing code duplication. This change likely aims to improve maintainability by consolidating similar logic into a single generic function.
Commit Log
refactor: merge getIntSlice and getFloatSlice
AI Summary
The commit adds documentation for new flag types `Float32Flag` and `Float64Flag` in the CLI project. This change is likely to improve clarity for users on how to handle float-based command-line flags.
Commit Log
docs: basics
AI Summary
The code adds new tests for float and float slice argument parsing, validation, and conversion in the CLI library. It also updates some flag-related tests to handle float slice types and improves test coverage for default values and nil slice handling.
Commit Log
tests: add more tests
AI Summary
The commit updates the golangci-lint configuration to enable the gofumpt formatter. It also removes the old gofumpt setup and formatting steps from the GitHub Actions lint workflow.
Commit Log
chore: update golangci-lint configuration
AI Summary
The code introduces support for float32 and float64 types in the CLI library by adding new types and functions to handle these numeric types. It includes new methods for parsing, setting, and retrieving float32 and float64 values, along with corresponding tests to ensure correctness. The changes involve generic type handling and the use of unsafe.Sizeof to determine the bit size of float types, which could introduce potential compatibility issues if not handled carefully.
Commit Log
feat: float32, float64
AI Summary
The code adds support for float32 and float64 types in the CLI library by introducing new functions, types, and variables. It includes new methods for handling float32 and float64 flags, arguments, and slices, along with updated type definitions.
Commit Log
chore: generate
AI Summary
The code refactors shared test logic for context value collection into a reusable ctxCollector struct to reduce duplication. It replaces hardcoded key types and context value collection logic with a generic collector that maps context keys to values by function name.
Commit Log
extract some shared test code into ctxCollector
AI Summary
The code change introduces a new `run` method that returns a context, ensuring that defer functions in the calling scope use the updated context from subcommands. This fixes an issue where context values set in Before functions were not available in After functions when subcommands were executed.
Commit Log
use correct context in After function with subcommand When adding values to a context in a Before function that value is not present in the After function when a subcommand was run. Without the subcommand the value is present. This fixes that be returning the new context from the subcommand and changing the context in the calling function. Defer'd function now pick up the new context. Fixes #2098
AI Summary
The code adds a test for the MutuallyExclusiveFlags feature in the cli package, ensuring that the After function is called when mutually exclusive flags are used. The test verifies that the After function is executed even when multiple mutually exclusive flags are provided, which could indicate a potential conflict.
Commit Log
Add test for MutuallyExclusiveFlags with After (#2107) For #2098
AI Summary
The code change modifies the condition in the setupDefaults function to only apply when both isRoot and EnableShellCompletion are true. This likely aims to enable shell completion only for root commands, improving user experience and preventing unintended behavior.
Commit Log
Fix tests
AI Summary
The code change ensures fish shell completion works by modifying the condition in setupDefaults to check if the command is the root command. The fish completion logic now uses the root command's ToFishCompletion method to generate the correct output.
Commit Log
Fix:(issue_2105) Ensure fish completion works
AI Summary
The code adds a new v3 bug report issue template for the GitHub repository to help users report bugs related to the v3 version of urfave/cli. The template includes sections for version information, reproduction steps, expected vs observed behavior, and additional context to aid in debugging.
Commit Log
Add v3 issue template
AI Summary
The code adds an example demonstrating how to make a shell completion command public in a CLI application. It shows how to use `BuildCompletionCommand` to create a completion command, customize it, and append it to the root command's list of commands.
Commit Log
docs: update the shell completion guide
AI Summary
The code adds a new function BuildCompletionCommand to the Command struct, likely for generating completion commands for CLI tools. This change is part of updating documentation or test data to reflect new functionality related to CLI completion.
Commit Log
docs: update the document ```sh make v3approve ```
AI Summary
The commit adds a new function `BuildCompletionCommand` to the `Command` struct, likely for generating command-line completion scripts. This change is part of improving documentation or tooling support for command-line interface completion.
Commit Log
docs: update the document ```sh make generate ```
AI Summary
The code replaces the placeholder $COMMAND in the completion description with the provided appName. This change ensures the completion command description dynamically reflects the actual application name.
Commit Log
fix: replace $COMMAND with appName
AI Summary
The code adds a new completion command with a detailed description for generating shell completion scripts in various shells. The command includes usage instructions for bash, zsh, fish, and PowerShell, enhancing user experience and documentation.
Commit Log
feat: add the default usage and description
AI Summary
The code change renames the function `buildCompletionCommand` to `BuildCompletionCommand` to allow customization of the completion command. This change enables users to override the default completion command behavior by defining their own `BuildCompletionCommand` function.
Commit Log
feat: publish buildCompletionCommand This allows you to customize completion command.
AI Summary
The code change replaces the use of fmt.Printf with fmt.Println in two instances to improve readability and output formatting. This change is likely made to make the output more user-friendly by adding a space between the string and the variable value.
Commit Log
Fix gfmrun
AI Summary
The code adds documentation for advanced argument handling in the cli library, including single and multi-value argument types. It explains how to use predefined types like IntArg, FloatArg, and TimestampArg for typed argument retrieval and destination binding.
Commit Log
Add docs for arg types
AI Summary
The code adds a new test function TestArgUsage to verify the behavior of the Usage() method on an IntArg struct. The test checks both the default usage text and a custom usage text to ensure the method returns the correct value.
Commit Log
Add tests
AI Summary
The code adds test cases for argument parsing functionality in the cli/v3 package, specifically for integer, uint, and timestamp types, as well as validation of invalid types. The tests include assertions for expected values and error handling when invalid input is provided, ensuring robustness in argument parsing logic.
Commit Log
Add tests
AI Summary
The code adds specific test functions for different integer and uint types to validate argument parsing behavior in the CLI library. It replaces generic type-based tests with concrete type tests, ensuring that each type (int, int8, etc.) is properly handled by the CLI argument parsing logic.
Commit Log
Add tests
AI Summary
The code adds test cases to verify that the root command correctly handles various integer argument types. These tests ensure that the command returns default values (zero) for different integer types when arguments are not provided.
Commit Log
Add more tests
AI Summary
The code adds generic test functions for validating argument parsing with different integer types and their array variants. These tests ensure that the CLI library correctly handles various integer types and their array forms across different test cases.
Commit Log
Add tests
AI Summary
The code introduces new functions and types for handling 16-bit, 32-bit, and 64-bit integer flags and arguments in the CLI project, replacing older int64-based implementations. This change likely aims to support more precise data types and improve type safety by allowing finer-grained control over integer sizes in command-line flags and arguments.
Commit Log
run make v3approve
AI Summary
The code adds support for various integer and unsigned integer types (e.g., int8, int16, uint, etc.) in the cli package by introducing new type definitions and functions to handle these types. This change likely aims to enhance flexibility and type safety by allowing users to work with different numeric types rather than being limited to int64 and uint64.
Commit Log
Add support to different int/uint types
AI Summary
The code changes fix test cases by updating expected values and modifying the Parse function to assign values directly instead of appending. The changes likely address test failures related to unbounded arguments and optional arguments by aligning expected results with actual behavior.
Commit Log
Fix tests
AI Summary
The code is refactoring the argument handling system to support multiple arguments (plural) instead of single arguments (singular). This change introduces new types and methods for handling slices of values, such as IntArgs, FloatArgs, and StringArgs, which likely support parsing and managing multiple values for flags and arguments.
Commit Log
Run make v3approve
AI Summary
The code introduces a new ArgumentsBase struct and associated methods to support handling multiple values for command-line arguments, replacing the previous single-value ArgumentBase. This change likely aims to improve flexibility by allowing arguments to accept multiple values, with corresponding updates to test files and method signatures for compatibility. Potential risks include breaking existing code that relies on the old single-value behavior, and possible issues with type conversions or handling of multiple values in existing logic.
Commit Log
Test
AI Summary
The code introduces a generic ArgumentBase struct and associated methods to support various argument types like StringArg, FloatArg, etc., enabling more flexible argument handling in the CLI library. New methods like HasName, Usage, Parse, and Get are added to the ArgumentBase struct to provide common functionality for argument processing. The code also adds new methods to the Command type for retrieving specific argument values, such as StringArg, FloatArg, and IntArg.
Commit Log
Add more args
AI Summary
The code adds assertions to test the behavior of argument parsing in the CLI library, specifically checking the output of UintArgs and IntArgs methods. The changes are focused on ensuring that the argument parsing logic correctly handles expected and invalid types, improving test coverage for edge cases.
Commit Log
Add coverage
AI Summary
The code adds a `Get()` method to the `Argument` interface and its implementation in `ArgumentBase`, allowing retrieval of argument values. This change enables programs to access the parsed argument values in a unified way, improving flexibility and usability.
Commit Log
Test
AI Summary
The code adds a test case to validate the handling of invalid integer values in the arguments parsing logic. The test case checks for an error when parsing a non-integer string as an integer, ensuring the error message is correctly captured.
Commit Log
Add coverage
AI Summary
The code updates test cases for argument handling in the CLI library, refactoring them to use a table-driven approach for better readability and maintainability. It introduces structured test cases with expected values and error strings, improving test coverage and clarity. The changes include replacing hardcoded test cases with a more flexible and scalable test setup.
Commit Log
Update tests
AI Summary
The code adds tracing and test cases for handling float arguments and invalid types in the CLI library. It modifies the FloatArgs function to include tracing for debugging and updates test cases to ensure correct behavior for invalid types. The changes may affect compatibility if other parts of the codebase rely on the previous behavior of FloatArgs or the parsing logic.
Commit Log
Fix tests
AI Summary
The code changes introduce a new method `getArgValue` and refactor several argument retrieval methods to use it, improving code reuse and maintainability. The changes also update test cases to include support for `uint64` values, aligning with the new functionality and ensuring comprehensive test coverage.
Commit Log
Fix more tests
AI Summary
The code introduces new methods and interfaces for handling arguments in the CLI library, including parsing, value retrieval, and error handling. The changes include test improvements with structured test cases and error checking, which enhance test coverage and robustness. Potential risks include breaking changes if existing code relies on the old behavior of argument parsing or if the new error handling is not compatible with existing error handling logic.
Commit Log
Test
AI Summary
The commit updates documentation to include new flag types for both basic and advanced flag examples. It adds support for various integer and unsigned integer slice flags in the advanced example.
Commit Log
Fix:(PR-2094) Update docs for new types
AI Summary
The code changes are focused on updating type signatures from int64 to int in specific documentation examples. This likely aims to align the examples with the current expected types in the CLI library, improving accuracy and consistency.
Commit Log
PR-2094: Fix docs
AI Summary
The code adds a method to set the default value of a flag before parsing, ensuring the flag has a default if not provided. This change ensures that the `extFlag` respects the default value defined in `flag.DefValue` prior to parsing, preventing unexpected behavior.
Commit Log
fix(extFlag): extFlag doesn't set default value prior to parsing * `extFlag.PreParse()` will set the value to that of `flag.DefValue`.
AI Summary
The code adds support for various integer and unsigned integer types (int8, int16, int32, int64, uint8, uint16, uint32, uint64) to the CLI library, replacing the previous int64 and uint64-only implementation. This change introduces new types and associated functions to handle each integer type, including parsing, formatting, and value retrieval, while maintaining compatibility with existing code through base-10 formatting by default.
Commit Log
feat!: add more integers and unsigned integers * Reintroduced all variants of integers and unsigned integers. * Fixed the use of base by using `IntegerConfig.Base` and defaulting to base 10 when formatting. Fixes: #2050
AI Summary
The commit updates the migration guide to reflect the correct usage of the altsrc package with version v3. It specifies the required version of the altsrc package and adjusts the example code to use the new API.
Commit Log
docs: fix altsrc example
AI Summary
The code update fixes an example in the migration guide to use the correct package and function for handling JSON sources in the new CLI version. It ensures compatibility with the updated `cli-altsrc/v3` package by specifying the correct import and usage of the `JSON` function with a `StringSourcer`.
Commit Log
docs: fix precedence example
AI Summary
The code changes improve documentation examples by replacing manual ValueSourceChain creation with cli.NewValueSourceChain for clarity and consistency. This change likely simplifies usage and reduces potential errors when constructing value source chains in the CLI library.
Commit Log
docs: improve chain examples
AI Summary
The code change updates an example in the migration guide to use the new altsrc package for flag handling. It replaces the old cli.StringFlag with altsrc.NewStringFlag to demonstrate how to migrate flags to the v3 version of the cli package.
Commit Log
docs: fix precedence example
AI Summary
The commit updates documentation to provide more detailed examples of using ValueSourceChain for File and EnvVars in the cli package. It replaces deprecated FilePath and EnvVars with the new Sources configuration, which allows for more flexible value sourcing.
Commit Log
docs: improve FilePath and EnvVars exmaples
AI Summary
The commit updates documentation examples to use the `cli` package for `Files` and `EnvVars` functions. This change ensures consistency with the current API and improves clarity for users migrating from v2 to v3.
Commit Log
docs: fix FilePath and EnvVars examples
AI Summary
The code change updates the example in the migration guide to use the new `altsrc.NewStringFlag` function instead of the old `altsrc.StringFlag` syntax. This change ensures compatibility with the latest version of the CLI library by aligning the example with the updated API.
Commit Log
docs: fix altsrc example
AI Summary
The code change updates the way ValueSourceChain is defined in the documentation to use a slice of ValueSource instead of a variadic Chain field. This change improves clarity and consistency with the current API, making it easier for users to understand how to define multiple sources.
Commit Log
docs: fix chain example
AI Summary
The commit improves the migration guide from v2 to v3 of the cli library, focusing on updated import strings, changes in source handling, and function signature updates. It introduces new sections for altsrc, authors, and shell completion, providing code examples for v2 and v3 to help users transition smoothly. The guide also highlights changes in the order of precedence for envvars, filepaths, and altsrc, which may affect existing configurations.
Commit Log
docs: improve migration guide v3
AI Summary
The code adds migration guidance for the TimestampFlag change between CLI versions 2 and 3. The migration requires updating the TimestampFlag to use a Config struct with Layouts instead of a single Layout field.
Commit Log
docs: add TimestampFlag migration
AI Summary
The code improves migration guides for CLI version updates by adding clear, version-specific code examples and explanations for changes like import strings, flag handling, and command structures. It introduces side-by-side comparisons between old and new syntax to help developers understand and adapt to the changes in the CLI library across versions.
Commit Log
docs: improve migration guides render
AI Summary
The commit updates the documentation for shell completions to fix formatting issues. It ensures the example code block is properly formatted without trailing newlines.
Commit Log
Fix docs for shell completions
AI Summary
The commit adds a step to clone the repository before running `actions/setup-go` in the lint workflow. This ensures that the `go.sum` file is available for caching, which is required by `actions/setup-go` to restore dependencies properly.
Commit Log
ci: Run `actions/setup-go` after `actions/checkout` `actions/setup-go` uses `go.sum` file as the cache key. The CI needs to clone the repository first in order to restore the cache properly.
AI Summary
The commit updates the `.golangci.yaml` configuration to enforce stricter linting rules. It removes certain linters and exclusions, potentially increasing code quality and reducing false positives.
Commit Log
Stricter `.golangci.yaml` configuration
AI Summary
The commit updates a link in the migration documentation from an issue to a discussion thread on GitHub. This change likely improves the relevance and accessibility of the migration discussion for users.
Commit Log
docs: fix the link to the migration discussion from v2 to v3
AI Summary
The commit fixes documentation issues related to the v3 CLI library, including updates to flag descriptions and argument type handling. Changes include correcting flag type descriptions, updating YAML examples, and removing an outdated documentation entry.
Commit Log
Fix:(issue_2086) Fix failed docs publish
AI Summary
The code diff updates golangci-lint to version 2, which likely improves linting rules and compatibility with modern Go practices. Several formatting changes were made in fish.go and help.go, replacing strings.Replace with strings.ReplaceAll for consistency and efficiency. The TestFlagAction function in command_test.go was modified to use fmt.Fprintf instead of manually writing to a Writer, improving readability and maintainability.
Commit Log
chore: Bump golangci-lint to v2
AI Summary
The code ensures that the onUsageError handler is invoked when command arguments are in error, specifically for subcommands. This change addresses an issue where the onUsageError function was not being called for subcommands, potentially leading to missed error handling.
Commit Log
Fix:(issue_2077) Make sure onUsageError is invoked for command when args are in error
AI Summary
The code diff is rolling out v3 documentation for cli, adding examples and updates to various features like arguments, flags, completions, and version handling. It introduces new documentation files for advanced flag usage, argument types, shell completions, and value sources, while reorganizing existing documentation for better structure and clarity. Potential risks include breaking changes if the v3 API differs significantly from previous versions, and compatibility issues if the documentation doesn't accurately reflect the current implementation.
Commit Log
Fix:(issue_1891) Roll out v3 docs
AI Summary
The code adds a test function for a string flag with a terminator in the cli package. The test is likely added to ensure the CLI handles string flags correctly when terminated with '--'.
Commit Log
Run gofmt
AI Summary
The code adds new test functions for flag parsing and command setup behavior, including tests for string, bool, and slice string flags with various input scenarios. Multiple instances of `setupDefaults` are updated to use `test` instead of `cli.test`, likely to align with a new test setup or naming convention.
Commit Log
Add more tests
AI Summary
The code change removes the '--' argument from the parsed arguments slice to handle flag termination correctly. This adjustment ensures that '--' is no longer treated as a positional argument but as a flag terminator, aligning with expected CLI behavior. Test cases have been updated to reflect this change, ensuring that the '--' is no longer expected in certain positions.
Commit Log
Remove -- from arg slice
AI Summary
The code change involves renaming a test function from 'TestFlagMutuallyExclusiveFlags' to a new name, likely to improve clarity or align with naming conventions. The function is part of a test suite for CLI flag mutual exclusion logic, ensuring flags cannot be used together.
Commit Log
Run gofmt
AI Summary
The code adds mutex flags support by modifying the Run function to call allFlags() instead of Flags, ensuring all flags are processed. The PostParse method for MutuallyExclusiveFlags is removed, likely to avoid redundant processing and improve performance.
Commit Log
Add mutex flags for post parse
AI Summary
The code adds support for handling mutually exclusive flags by calling PostParse on mutex groups during command execution. This ensures that flag validation and post-parsing logic is executed for mutually exclusive flag groups, improving flag consistency and error handling.
Commit Log
Add mutex group flags to post parse
AI Summary
The code reorganizes and enhances the test for mutually exclusive flags in the CLI library to improve test coverage and structure. It introduces a test suite with multiple test cases, including scenarios for required flags, environment variables, and error messages.
Commit Log
Organize mutex tests
AI Summary
The code simplifies flag lookup by replacing explicit loops with slice functions, improving readability and reducing boilerplate. The changes reduce the number of lines and make the logic more concise, but may impact performance in certain edge cases due to the use of slices.
Commit Log
Simplify code
AI Summary
The code adds a defer statement to restore the defaultSliceFlagSeparator after a test. This ensures that the test does not leave the separator changed, maintaining state consistency.
Commit Log
Add defer
AI Summary
The code changes focus on improving test coverage and fixing specific flag handling behaviors in the CLI library. The removal of redundant checks in the Run function simplifies the logic and improves maintainability. New tests are added to cover edge cases like slice flag separators, boolean flags with inverses, and environment variable flag parsing.
Commit Log
Add more tests
AI Summary
The commit removes a comment about 'nolint' from the TypeName method documentation in the BoolWithInverseFlag type. This change likely aims to clean up or standardize the documentation comments without altering functionality.
Commit Log
run v3approve
AI Summary
The code changes primarily focus on replacing custom helper functions with standard library functions like slices.Contains for improved readability and maintainability. Several test cases were added, including a new test for timestamp flags, which ensures the correct help output formatting for timestamp flags. The changes also include simplifications in the BoolWithInverseFlag implementation, removing redundant checks and improving the TypeName method.
Commit Log
Fix tests
AI Summary
The code changes remove assignments to cmd.parsedArgs in the parseFlags function and replace them with direct returns of &stringSliceArgs{posArgs}, likely to eliminate redundant state storage. The Run function now directly uses cmd.parsedArgs, which was previously set in parseFlags, indicating a refactoring to simplify or optimize the argument parsing flow.
Commit Log
remove dead code
AI Summary
The commit adds a comment explaining the purpose of the TypeName method for the BoolWithInverseFlag type. The comment clarifies that TypeName is a no-op for bools and justifies the nolint directive.
Commit Log
run v3approve
AI Summary
The code changes replace direct calls to `cmd.Set` with calls to `require.NoError` to handle potential errors during flag value setting. This change is likely made to improve test reliability by ensuring that any errors during flag setting are explicitly checked and reported.
Commit Log
Fix lint
AI Summary
The code changes primarily focus on fixing linting and formatting issues, such as whitespace, comment formatting, and test function adjustments. No functional changes are introduced, as the code is mostly about improving code style and ensuring consistency. Potential risks include minor compatibility issues if the codebase relies on specific formatting rules or linters that were previously configured differently.
Commit Log
Fix lint/format errors
AI Summary
The code changes are focused on improving test coverage and fixing issues related to the BoolWithInverseFlag type, particularly in test cases and documentation. The changes include adding new test cases, updating test logic to use the new flag type, and improving documentation for the TypeName method.
Commit Log
Fix more tests
AI Summary
The code changes fix test cases to ensure correct assertion order and add additional test scenarios for flag validation. The changes improve test reliability by aligning the expected and actual values in assertions and testing edge cases like PreParse failures.
Commit Log
Fix more tests
AI Summary
The code removes a skipped test for the 'TestArgumentsSubcommand' function, likely to enable it to run. This change may improve test coverage but could introduce risks if the test is not fully implemented or handles edge cases improperly.
Commit Log
Fix more tests