Skip to content

Commit

Permalink
retain leading and trailing spaces in string slice flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoisaiah committed Nov 23, 2024
1 parent f2749b4 commit 69054a4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.3 (2024-11-23)

- Fix bug caused by space trimming in `--find`, `--replace`, `--exclude`, and
`--exclude-dir`

## 2.0.2 (2024-11-22)

- Fix bug with using commas in find or replace strings
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func CreateCLIApp(r io.Reader, w io.Writer) *cli.App {
Usage: `f2 bulk renames files and directories, matching files against a specified
pattern. It employs safety checks to prevent accidental overwrites and
offers several options for fine-grained control over the renaming process.`,
Version: "v2.0.1",
Version: "v2.0.3",
EnableBashCompletion: true,
Flags: []cli.Flag{
flagCSV,
Expand Down
2 changes: 1 addition & 1 deletion app/app_test/testdata/help_stdout.golden
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
f2 v2.0.1
f2 v2.0.3
Ayooluwa Isaiah <[email protected]>

f2 bulk renames files and directories, matching files against a specified
Expand Down
4 changes: 2 additions & 2 deletions app/app_test/testdata/version_stdout.golden
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
f2 version v2.0.1
https://github.com/ayoisaiah/f2/releases/v2.0.1
f2 version v2.0.3
https://github.com/ayoisaiah/f2/releases/v2.0.3
4 changes: 4 additions & 0 deletions app/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (
When -s/--string-mode is used, this pattern is treated as a literal string.`,
DefaultText: "<pattern>",
KeepSpace: true,
}

flagReplace = &cli.StringSliceFlag{
Expand All @@ -31,6 +32,7 @@ var (
It supports capture variables, built-in variables, and exiftool variables.
If omitted, it defaults to an empty string.`,
DefaultText: "<string>",
KeepSpace: true,
}

flagUndo = &cli.BoolFlag{
Expand Down Expand Up @@ -70,6 +72,7 @@ var (
--exclude-dir instead).`,

DefaultText: "<pattern>",
KeepSpace: true,
}

flagExcludeDir = &cli.StringSliceFlag{
Expand All @@ -78,6 +81,7 @@ var (
Prevents F2 from recursing into directories that match the provided regular
expression pattern.`,
DefaultText: "<pattern>",
KeepSpace: true,
}

flagExec = &cli.BoolFlag{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ayoisaiah/f2",
"version": "2.0.2",
"version": "2.0.3",
"description": "F2 is a command-line tool for batch renaming multiple files and directories quickly and safely",
"main": "index.js",
"repository": "https://github.com/ayoisaiah/f2",
Expand Down

0 comments on commit 69054a4

Please sign in to comment.