aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/build.py b/build.py
index 5c6ffd6..6fed879 100644
--- a/build.py
+++ b/build.py
@@ -69,20 +69,22 @@ def build_odt(srcdir,destdir):
def main():
parser = argparse.ArgumentParser(description='building script')
+ parser.add_argument('directory',nargs='+',choices=['esempi','strumenti'])
parser.add_argument('-H','--html',action='store_true')
parser.add_argument('-l','--latex',action='store_true')
parser.add_argument('-p','--pdf',action='store_true')
parser.add_argument('-o','--odt',action='store_true')
args = parser.parse_args()
- if args.html:
- build_html('esempi',os.path.join('build','html','esempi'))
- if args.latex or args.pdf:
- build_latex('esempi',os.path.join('build','latex','esempi'))
- if args.pdf:
- build_pdf(os.path.join('build','latex','esempi'),
- os.path.join('build','pdf','esempi'))
- if args.odt:
- build_odt('esempi',os.path.join('build','odt','esempi'))
+ for dirname in args.directory:
+ if args.html:
+ build_html(dirname,os.path.join('build','html',dirname))
+ if args.latex or args.pdf:
+ build_latex(dirname,os.path.join('build','latex',dirname))
+ if args.pdf:
+ build_pdf(os.path.join('build','latex',dirname),
+ os.path.join('build','pdf',dirname))
+ if args.odt:
+ build_odt(dirname,os.path.join('build','odt',dirname))
if __name__ == '__main__': main()