Browse Source

Implementet help function using heredoc

Matteo Zeccoli Marazzini 5 years ago
parent
commit
63a29e2a46
2 changed files with 4 additions and 23 deletions
  1. 0 19
      helpfile
  2. 4 4
      parse-arguments.sh

+ 0 - 19
helpfile

@@ -1,19 +0,0 @@
-newdisk automator
-This program can be used in two mode: automatic and manual.
-
-Automatic:
-newdisk-automator [-f] device
-device is partitioned according to the following scheme:
-	- calcolo: 100GB
-	- swap: ram size + 1GB
-	- free space: 10% of the total
-	- condor: 40% of remaining space
-	- tempdir: 60% of remaining space
-If the size of the disk is less than 102GB + ram size, this mode cannot be used.
-If the size of the disk is greater than the minimum size, but still less than (100GB + ram size) * 2, to use this mode the -f option must be passed.
-Be careful: in the automatic mode, calcolo and swap size are fixed, and forcing it with -f could result in having very small tempdir and condor partitions. 
-
-Manual:
-newdisk-automator device temp condor swap vm
-The partitions are assigned the size passed on the command line, which is assumed to be in GB.
-If the total passed with the command line is greater than the size of the disk, the program stops.

+ 4 - 4
parse-arguments.sh

@@ -7,8 +7,8 @@ parse_arguments()
 		case $o in
 		f) FORCE=1;;
 		h) help && exit 0;;
-		v) SCRIPT_OUTPUT=/proc/self/fd/1 && PROGRAM_OUTPUT=/proc/self/fd/1;;
-		q) SCRIPT_OUTPUT=/dev/null && PROGRAM_OUTPUT=/dev/null;;
+		v) PROGRAM_OUTPUT=/proc/self/fd/1;;
+		q) SCRIPT_OUTPUT=/dev/null;;
 		\?) usage && exit;;
 		esac
 	done
@@ -72,7 +72,7 @@ newdisk automator
 This program can be used in two mode: automatic and manual.
 
 Automatic:
-newdisk-automator [-f] device
+newdisk-automator [-qvf] device
 device is partitioned according to the following scheme:
 	- calcolo: 100GB
 	- swap: ram size + 1GB
@@ -84,7 +84,7 @@ If the size of the disk is greater than the minimum size, but still less than (1
 Be careful: in the automatic mode, calcolo and swap size are fixed, and forcing it with -f could result in having very small tempdir and condor partitions. 
 
 Manual:
-newdisk-automator device temp_size condor_size swap_size vm_size
+newdisk-automator [-qv] device temp_size condor_size swap_size vm_size
 The partitions are assigned the size passed on the command line. b, K, M, G can be appended to the sizes for bytes, kibibytes, mebibytes and gibibytes. The default is bytes.
 If the total passed with the command line is greater than the size of the disk, the program stops.
 help-end