Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Commit

Permalink
Add option to disable trailing new line char
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault Gilles committed Jul 27, 2013
1 parent 39c327d commit 453a2ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/vcprompt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Options:
-t, --timeout The max execution time in milliseconds
-v, --version Show program's version number and exit
-h, --help Show this help message and exit
-n, --no-newline Do not append a new line char in output
Formatting options:
-u, --unknown UNKNOWN The "unknown" value. Default is "(unknown)"
Expand Down Expand Up @@ -213,6 +214,7 @@ def main():
parser.add_option('-U', '--untracked', dest='untracked', default=UNTRACKED)
parser.add_option('-u', '--unknown', dest='unknown', default=UNKNOWN)
parser.add_option('-v', '--version', action='callback', callback=version)
parser.add_option('-n', '--no-newline', action='store_true', dest='noNewline', default=False)

# vcs-specific formatting
for system in SYSTEMS:
Expand All @@ -231,6 +233,7 @@ def main():
timer.start()

output = vcprompt(options)
output += '\n' if not options.noNewline else ''
return output


Expand Down Expand Up @@ -625,6 +628,6 @@ def svn(options):
if __name__ == '__main__':
prompt = main()
if prompt:
sys.stdout.write(prompt + '\n')
sys.stdout.write(prompt)
else:
sys.exit(1)

0 comments on commit 453a2ba

Please sign in to comment.