| 81 | |
| 82 | |
| 83 | def arguments(argsval): |
| 84 | parser = argparse.ArgumentParser() |
| 85 | parser.add_argument('-nw', '--no_weekends', |
| 86 | required=False, action='store_true', default=False, |
| 87 | help="""do not commit on weekends""") |
| 88 | parser.add_argument('-mc', '--max_commits', type=int, default=10, |
| 89 | required=False, help="""Defines the maximum amount of |
| 90 | commits a day the script can make. Accepts a number |
| 91 | from 1 to 20. If N is specified the script commits |
| 92 | from 1 to N times a day. The exact number of commits |
| 93 | is defined randomly for each day. The default value |
| 94 | is 10.""") |
| 95 | parser.add_argument('-fr', '--frequency', type=int, default=80, |
| 96 | required=False, help="""Percentage of days when the |
| 97 | script performs commits. If N is specified, the script |
| 98 | will commit N%% of days in a year. The default value |
| 99 | is 80.""") |
| 100 | parser.add_argument('-r', '--repository', type=str, required=False, |
| 101 | help="""A link on an empty non-initialized remote git |
| 102 | repository. If specified, the script pushes the changes |
| 103 | to the repository. The link is accepted in SSH or HTTPS |
| 104 | format. For example: git@github.com:user/repo.git or |
| 105 | https://github.com/user/repo.git""") |
| 106 | parser.add_argument('-un', '--user_name', type=str, required=False, |
| 107 | help="""Overrides user.name git config. |
| 108 | If not specified, the global config is used.""") |
| 109 | parser.add_argument('-ue', '--user_email', type=str, required=False, |
| 110 | help="""Overrides user.email git config. |
| 111 | If not specified, the global config is used.""") |
| 112 | parser.add_argument('-db', '--days_before', type=int, default=365, |
| 113 | required=False, help="""Specifies the number of days |
| 114 | before the current date when the script will start |
| 115 | adding commits. For example: if it is set to 30 the |
| 116 | first commit date will be the current date minus 30 |
| 117 | days.""") |
| 118 | parser.add_argument('-da', '--days_after', type=int, default=0, |
| 119 | required=False, help="""Specifies the number of days |
| 120 | after the current date until which the script will be |
| 121 | adding commits. For example: if it is set to 30 the |
| 122 | last commit will be on a future date which is the |
| 123 | current date plus 30 days.""") |
| 124 | return parser.parse_args(argsval) |
| 125 | |
| 126 | |
| 127 | if __name__ == "__main__": |