Skip to content

Instantly share code, notes, and snippets.

@cubicdaiya
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cubicdaiya/11282654 to your computer and use it in GitHub Desktop.
Save cubicdaiya/11282654 to your computer and use it in GitHub Desktop.
formater for `nginx -V`
# -*- coding: utf-8 -*-
import commands
def nginxV_except_configure_args():
return commands.getoutput('nginx -V 2>&1 | grep -v "configure arguments:" ')
def nginxV_only_configure_args():
return commands.getoutput('nginx -V 2>&1 | grep "configure arguments:" ')
if __name__ == '__main__':
args_prefix = nginxV_only_configure_args().split(' ')[:2]
args = nginxV_only_configure_args().split(' ')[2:]
print nginxV_except_configure_args()
print ' '.join(args_prefix) + '\n' + "\n".join(args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment