X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-util.git;a=blobdiff_plain;f=source%2Fnew-driver;h=14178d3241dfb5849abe4886aff646601444f6d1;hp=61a3960877489c259519d11b838afa9a55b677f5;hb=149202b4da310b2828447711db6adbe07e7d815a;hpb=c1edc7e311eadf730946e65695cca0daa09f9d04 diff --git a/source/new-driver b/source/new-driver index 61a3960..14178d3 100755 --- a/source/new-driver +++ b/source/new-driver @@ -178,7 +178,7 @@ if __name__ == '__main__': author, email = parse_gitconfig() parser = ArgumentParser(description='Bootstrap a new sigrok hardware driver') - parser.add_argument('name', help='new driver name') + parser.add_argument('name', nargs='*', default=[], help='new driver name') parser.add_argument('--giturl', default=defaulturl, help='URL of the libsigrok git repository ' '(defaults to {0})'.format(defaulturl)) @@ -194,7 +194,9 @@ if __name__ == '__main__': if not opts.author or not opts.email: parser.error('Please provide your username and email address, ' 'or set your git configuration up.') - name = opts.name + name = ' '.join(opts.name) + if not name: + parser.error('Please provide a driver name.') names = { 'name': name, 'short': re.sub('[^a-z0-9]', '-', name.lower()),