def standard_arguments(parser):
    """Add required and optional arguments common to all scripts"""
    parser._action_groups.pop()
    required = parser.add_argument_group('required arguments')
    optional = parser.add_argument_group('optional arguments')
    required.add_argument('-s', dest='server', action='store', required=True, help="DHIS2 server URL")
    required.add_argument('-u', dest='username', action='store', required=True, help='DHIS2 username')
    optional.add_argument('-p', dest='password', action='store', required=False, help='DHIS2 password')
    return required, optional