Last active
August 29, 2015 14:00
-
-
Save cubicdaiya/11282654 to your computer and use it in GitHub Desktop.
formater for `nginx -V`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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