def usage(code=0):
- sys.stderr.write("Usage: %s [-0|--null] [-o|--old] [-s|--spaces] [-w|--width] [width]\n" % sys.argv[0])
+ sys.stderr.write("Usage: %s [-0|--null] [-n|--no-newline] [-o|--old] [-s|--spaces] [-w|--width] [width]\n" % sys.argv[0])
sys.exit(code)
from getopt import getopt, GetoptError
try:
- options, arguments = getopt(sys.argv[1:], "0osw:",
- ["null", "old", "spaces", "width="])
+ options, arguments = getopt(sys.argv[1:], "0nosw:",
+ ["null", "no-newline", "old", "spaces", "width="])
except GetoptError:
usage(1)
print0 = False
+ newline = True
old = False
spaces = ''
width = None
usage()
elif option in ("-0", "--null"):
print0 = True
+ elif option in ("-n", "--no-newline"):
+ newline = False
elif option in ("-o", "--old"):
old = True
elif option in ("-s", "--spaces"):
else:
width = int(arguments[0])
- return print0, old, spaces, width
+ return print0, newline, old, spaces, width
-print0, old, spaces, width = get_args()
+print0, newline, old, spaces, width = get_args()
xsetbg_dir = os.path.join(os.environ["HOME"], "lib", "xsetbg")
if print0:
sys.stdout.write('\0')
-else:
+elif newline:
print