Skip to content

Commit de0e7a2

Browse files
Remove unneeded args (#42)
1 parent aa15ce6 commit de0e7a2

3 files changed

Lines changed: 20 additions & 33 deletions

File tree

doc/commands/add-pr-comment.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
# add-pr-comment
44
```
5-
usage: gitopscli add-pr-comment [-h] [-b BRANCH] [-u USERNAME] [-p PASSWORD]
6-
[-j GIT_USER] [-e GIT_EMAIL] [-c [CREATE_PR]]
7-
[-a [AUTO_MERGE]] -o ORGANISATION -n
8-
REPOSITORY_NAME [-s GIT_PROVIDER]
5+
usage: gitopscli add-pr-comment [-h] [-u USERNAME] [-p PASSWORD]
6+
[-j GIT_USER] [-e GIT_EMAIL]
7+
-o ORGANISATION -n REPOSITORY_NAME [-s GIT_PROVIDER]
98
[-w GIT_PROVIDER_URL] -i PR_ID [-x PARENT_ID]
109
-t TEXT
1110
1211
optional arguments:
1312
-h, --help show this help message and exit
14-
-b BRANCH, --branch BRANCH
15-
Branch to push the changes to
1613
-u USERNAME, --username USERNAME
1714
Git username if Basic Auth should be used
1815
-p PASSWORD, --password PASSWORD
@@ -21,12 +18,6 @@ optional arguments:
2118
Git Username
2219
-e GIT_EMAIL, --git-email GIT_EMAIL
2320
Git User Email
24-
-c [CREATE_PR], --create-pr [CREATE_PR]
25-
Creates a Pull Request (only when --branch is not
26-
master/default branch)
27-
-a [AUTO_MERGE], --auto-merge [AUTO_MERGE]
28-
Automatically merge the created PR (only valid with
29-
--create-pr)
3021
-o ORGANISATION, --organisation ORGANISATION
3122
Apps Git organisation/projectKey
3223
-n REPOSITORY_NAME, --repository-name REPOSITORY_NAME

doc/commands/sync-apps.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
# sync-apps
44
```
5-
usage: gitopscli sync-apps [-h] [-b BRANCH] [-u USERNAME] [-p PASSWORD]
6-
[-j GIT_USER] [-e GIT_EMAIL] [-c [CREATE_PR]]
7-
[-a [AUTO_MERGE]] -o ORGANISATION -n
8-
REPOSITORY_NAME [-s GIT_PROVIDER]
5+
usage: gitopscli sync-apps [-h] [-u USERNAME] [-p PASSWORD]
6+
[-j GIT_USER] [-e GIT_EMAIL]
7+
-o ORGANISATION -n REPOSITORY_NAME [-s GIT_PROVIDER]
98
[-w GIT_PROVIDER_URL] -i ROOT_ORGANISATION -r
109
ROOT_REPOSITORY_NAME
1110
1211
optional arguments:
1312
-h, --help show this help message and exit
14-
-b BRANCH, --branch BRANCH
15-
Branch to push the changes to
1613
-u USERNAME, --username USERNAME
1714
Git username if Basic Auth should be used
1815
-p PASSWORD, --password PASSWORD
@@ -21,12 +18,6 @@ optional arguments:
2118
Git Username
2219
-e GIT_EMAIL, --git-email GIT_EMAIL
2320
Git User Email
24-
-c [CREATE_PR], --create-pr [CREATE_PR]
25-
Creates a Pull Request (only when --branch is not
26-
master/default branch)
27-
-a [AUTO_MERGE], --auto-merge [AUTO_MERGE]
28-
Automatically merge the created PR (only valid with
29-
--create-pr)
3021
-o ORGANISATION, --organisation ORGANISATION
3122
Apps Git organisation/projectKey
3223
-n REPOSITORY_NAME, --repository-name REPOSITORY_NAME

gitopscli/cliparser.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def __add_deploy_command_parser(subparsers):
4444
)
4545

4646
__add_git_parser_args(deploy_p)
47+
__add_branch_pr_parser_args(deploy_p)
4748

4849

4950
def __add_sync_apps_command_parser(subparsers):
@@ -65,15 +66,27 @@ def __add_pr_comment_command_parser(subparsers):
6566
def __add_create_preview_command_parser(subparsers):
6667
add_create_preview_p = subparsers.add_parser("create-preview", help="Create a preview environment")
6768
__add_git_parser_args(add_create_preview_p)
69+
__add_branch_pr_parser_args(add_create_preview_p)
6870
__add_create_prid_parser(add_create_preview_p)
6971

7072

7173
def __add_git_parser_args(deploy_p):
72-
deploy_p.add_argument("-b", "--branch", help="Branch to push the changes to", default="master")
7374
deploy_p.add_argument("-u", "--username", help="Git username if Basic Auth should be used")
7475
deploy_p.add_argument("-p", "--password", help="Git password if Basic Auth should be used")
7576
deploy_p.add_argument("-j", "--git-user", help="Git Username", default="GitOpsCLI")
7677
deploy_p.add_argument("-e", "--git-email", help="Git User Email", default="gitopscli@baloise.dev")
78+
deploy_p.add_argument("-o", "--organisation", help="Apps Git organisation/projectKey", required=True)
79+
deploy_p.add_argument(
80+
"-n", "--repository-name", help="Git repository name (not the URL, e.g. my-repo)", required=True
81+
)
82+
deploy_p.add_argument("-s", "--git-provider", help="Git server provider", default="bitbucket-server")
83+
deploy_p.add_argument(
84+
"-w", "--git-provider-url", help="Git provider base API URL (e.g. https://bitbucket.example.tld)"
85+
)
86+
87+
88+
def __add_branch_pr_parser_args(deploy_p):
89+
deploy_p.add_argument("-b", "--branch", help="Branch to push the changes to", default="master")
7790
deploy_p.add_argument(
7891
"-c",
7992
"--create-pr",
@@ -92,14 +105,6 @@ def __add_git_parser_args(deploy_p):
92105
const=True,
93106
default=False,
94107
)
95-
deploy_p.add_argument("-o", "--organisation", help="Apps Git organisation/projectKey", required=True)
96-
deploy_p.add_argument(
97-
"-n", "--repository-name", help="Git repository name (not the URL, e.g. my-repo)", required=True
98-
)
99-
deploy_p.add_argument("-s", "--git-provider", help="Git server provider", default="bitbucket-server")
100-
deploy_p.add_argument(
101-
"-w", "--git-provider-url", help="Git provider base API URL (e.g. https://bitbucket.example.tld)"
102-
)
103108

104109

105110
def __add_create_prid_parser(subparsers):

0 commit comments

Comments
 (0)