chiark / gitweb /
cryptop.public: Don't check an ACL.
[distorted-keys] / extract-profile.in
old mode 100644 (file)
new mode 100755 (executable)
index 1d19fc2..dc816f3
@@ -279,7 +279,7 @@ class Section (object, UD.DictMixin):
         left = dol + 1
         while left < n and (string[left].isalnum() or string[left] in '-_'):
           left += 1
-        prop = string[dol + 1:left].replace('-', '_')
+        prop = string[dol + 1:left]
 
       ## If we came up empty, report an error.
       if prop == '':
@@ -287,6 +287,7 @@ class Section (object, UD.DictMixin):
               "invalid placeholder (empty name) in `%s'" % string
 
       ## Extend the path: we're going to do a recursive expansion.
+      prop = prop.replace('-', '_')
       path.append(prop)
 
       ## Report a cycle if we found one.
@@ -403,7 +404,7 @@ def parse(filename, d):
 ### Main program.
 
 OP = O.OptionParser(
-  usage = '%prog FILE|DIRECTORY ... SECTION',
+  usage = '%prog SECTION FILE|DIRECTORY ...',
   version = '%%prog, version %s' % VERSION,
   description = '''\
 Parse the configurations FILE and DIRECTORY contents, and output the named
@@ -417,8 +418,8 @@ def main(args):
     opts, args = OP.parse_args(args[1:])
     if len(args) < 2:
       OP.error('not enough positional parameters')
-    files = args[:-1]
-    sect = args[-1]
+    sect = args[0]
+    files = args[1:]
 
     ## Read in the inputs.
     d = { '@GLOBAL': Section('@GLOBAL') }