Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default behaviour to include files of SOURCE directory #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
--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.
Expand Down
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
--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.
Expand Down Expand Up @@ -116,7 +117,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)
Expand Down