From 4c13c833298d0908c7beb7965cc457862d2efeaa Mon Sep 17 00:00:00 2001 From: anestv Date: Sat, 7 Oct 2017 20:22:39 +0000 Subject: [PATCH 1/3] Change default behaviour to include files of SOURCE directory --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 63e9d1b..f3621b8 100644 --- a/main.go +++ b/main.go @@ -62,7 +62,7 @@ func main() { usage := `flatten. Usage: - flatten [SOURCE] [DESTINATION] [-c | --copy-only] [-f | --force] [--include-source-files] [-s | --simulate-only] [--verbose] + flatten [SOURCE] [DESTINATION] [-c | --copy-only] [-f | --force] [--exclude-source-files] [-s | --simulate-only] [--verbose] flatten -h | --help flatten -v @@ -75,7 +75,7 @@ Arguments: Options: -c --copy-only Do not remove anything from the source directory. -f --force Do not propose a simulation first, immediately execute the command. - --include-source-files Include the files which are directly located in the SOURCE directory. + --exclude-source-files Do not include the files which are directly located in the SOURCE directory. -s --simulate-only Do not move or copy any files on the system, just output the expected result. --verbose Explain what is being done. @@ -116,7 +116,7 @@ Options: flatten.SetVerbose() } - includeSourceFiles := arguments["--include-source-files"].(bool) + includeSourceFiles := !arguments["--exclude-source-files"].(bool) copyOnly := arguments["--copy-only"].(bool) simulateOnly := arguments["--simulate-only"].(bool) force := arguments["--force"].(bool) From 7d46492c595e2ffaf864dfbfd5b66890d9242253 Mon Sep 17 00:00:00 2001 From: anestv Date: Sat, 7 Oct 2017 20:29:14 +0000 Subject: [PATCH 2/3] Updated README usage section: default to include SOURCE files --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d3df97a..d468891 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ go get github.com/goggle/flatten ``` Usage: - flatten [SOURCE] [DESTINATION] [-c | --copy-only] [-f | --force] [--include-source-files] [-s | --simulate-only] [--verbose] + flatten [SOURCE] [DESTINATION] [-c | --copy-only] [-f | --force] [--exclude-source-files] [-s | --simulate-only] [--verbose] flatten -h | --help flatten -v @@ -31,7 +31,7 @@ Arguments: Options: -c --copy-only Do not remove anything from the source directory. -f --force Do not propose a simulation first, immediately execute the command. - --include-source-files Include the files which are directly located in the SOURCE directory. + --exclude-source-files Do not include the files which are directly located in the SOURCE directory. -s --simulate-only Do not move or copy any files on the system, just output the expected result. --verbose Explain what is being done. From 142bf98701f88abbf96902a7345270638104d057 Mon Sep 17 00:00:00 2001 From: anestv Date: Sat, 7 Oct 2017 20:38:37 +0000 Subject: [PATCH 3/3] Wrapped long lines at usage --- README.md | 3 ++- main.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d468891..6a96c1e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,8 @@ Arguments: Options: -c --copy-only Do not remove anything from the source directory. -f --force Do not propose a simulation first, immediately execute the command. - --exclude-source-files Do not include the files which are directly located in the SOURCE directory. + --exclude-source-files Do not include the files which are directly + located in the SOURCE directory. -s --simulate-only Do not move or copy any files on the system, just output the expected result. --verbose Explain what is being done. diff --git a/main.go b/main.go index f3621b8..681f218 100644 --- a/main.go +++ b/main.go @@ -75,7 +75,8 @@ Arguments: Options: -c --copy-only Do not remove anything from the source directory. -f --force Do not propose a simulation first, immediately execute the command. - --exclude-source-files Do not include the files which are directly located in the SOURCE directory. + --exclude-source-files Do not include the files which are directly + located in the SOURCE directory. -s --simulate-only Do not move or copy any files on the system, just output the expected result. --verbose Explain what is being done.