-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix/2866/ccsh modify behavior 2 #3448
Changes from all commits
c585e27
b746078
774954a
5b22231
c0f0912
8453a45
c65ae64
ae7a8d2
6f413e9
393b3f4
4b3c824
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
# StructureModifier | ||
|
||
The StructureModifier is used to modify the structure of .cc.json files. It enables to ... | ||
The StructureModifier modifies .cc.json files.\ | ||
Perform one of the following actions at a time: | ||
|
||
- remove nodes from a project. The resulting project will not include these nodes and their children. | ||
- declare a node as root. This means that the chosen node will become the root node of the resulting sub-project. | ||
- move nodes within the project. All children of the source node will be transferred to the destination node. | ||
- print the hierarchy of the project. | ||
- Remove nodes from a project, excluding them and their children. | ||
- Set a node as the root, making it the root of the resulting sub-project. | ||
- Move nodes within the project, transferring all children of the source node to the destination node. | ||
- Print the project hierarchy. | ||
|
||
The edges and blacklist entries associated with moved/removed nodes will be altered as well, while all attribute types will be copied. | ||
Specifying multiple actions in a single command results in only one being performed.\ | ||
Edges and blacklist entries associated with moved or removed nodes will be adjusted, and all attribute types will be copied. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just as an information: Blacklist entries are still part of our latests cc.json structure. |
||
|
||
## Usage and Parameters | ||
|
||
| Parameter | description | | ||
| Parameter | Description | | ||
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | ||
| `[FILE]` | input project file | | ||
| `-f, --move-from=<moveFrom>` | move nodes in project folder... | | ||
| `-f, --move-from=<moveFrom>` | path of nodes to move in project folder | | ||
| `-h, --help` | displays this help and exits | | ||
| `-o, --output-file=<outputFile>` | output File (or empty for stdout) | | ||
| `-p, --print-levels=<printLevels>` | show first x layers of project hierarchy | | ||
| `-r, --remove=<remove>` | comma-separated list of nodes to be removed (when using powershell, the list either can't contain spaces or has to be in quotes) | | ||
| `-s, --set-root=<setRoot>` | path within project to be extracted | | ||
| `-t, --move-to=<moveTo>` | ... move nodes to destination folder | | ||
| `-s, --set-root=<setRoot>` | path within project to be extracted as new root | | ||
| `-t, --move-to=<moveTo>` | destination path of nodes to move in project folder<br/>creates / overwrites nodes at destination path | | ||
|
||
``` | ||
Usage: ccsh modify [-h] [-f=<moveFrom>] [-o=<outputFile>] [-p=<printLevels>] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package de.maibornwolff.codecharta.filter.structuremodifier | ||
|
||
enum class StructureModifierAction(val descripton: String) { | ||
PRINT_STRUCTURE("Print the structure of the project"), | ||
SET_ROOT("Extract a sub path as the new root"), | ||
MOVE_NODES("Move nodes within the project"), | ||
REMOVE_NODES("Remove nodes") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion would be to adjust this to "result in only the first action being performed", that way its more clear what the command will do (given we change the implementation to work that way).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this line. I see no argument to keep it. It should be clear from the documentation above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command should fail immediately if there is more than one action specified.
Otherwise it will not be obvious that the command is failing.
It will silently continueing with an unexpected behavior.