def check_args(args):
    """
    Checks validity of command line arguments and, in some cases
        modifies them a little bit.

    :param args: The command-line arguments.

    :type args: argparse.ArgumentParser Namespace

    :returns: argparse.ArgumentParser Namespace -- The updated command-line
        arguments.
    """
    if not args.outbase:
        print('Must specify an output base filename (--outbase).')
        raise SystemExit
    if args.aspfile:
        args.aspfile = str(args.aspfile).split(',')
    if not args.band and args.raw6file:
        print('Trying to derive band from raw6 filename...')
        if '-fd-raw6' in args.raw6file:
            args.band = 'FUV'
        elif '-nd-raw6' in args.raw6file:
            args.band = 'NUV'
        else:
            print(
                'Unable to parse band from raw6 filename. Specify band on command line using --band.'
                )
            raise SystemExit
    if not args.band:
        print('Band not specified.')
    else:
        args.band = args.band.upper()
        if not args.band in ['NUV', 'FUV']:
            print('Band must be NUV or FUV. ')
            raise SystemExit
    if not (args.raw6file or args.scstfile) and not args.eclipse:
        print('Must provide raw6 and scst files or specify eclipse.')
        raise SystemExit
    return args
