Skip to content

Commit

Permalink
Rename --zero to --null like xargs, use doc language from xargs
Browse files Browse the repository at this point in the history
  • Loading branch information
pnorman committed Jul 28, 2022
1 parent b6fc3e7 commit ed23089
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
scripts/indexes.py --reindex > /dev/null &&
scripts/indexes.py --concurrent --reindex > /dev/null &&
scripts/indexes.py --notexist > /dev/null &&
scripts/indexes.py --zero > /dev/null &&
scripts/indexes.py --zero > /dev/null
scripts/indexes.py --null > /dev/null &&
scripts/indexes.py --null > /dev/null
import:
needs: [syntax]
Expand Down
4 changes: 2 additions & 2 deletions scripts/indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
parser.add_argument('--notexist', help='Use IF NOT EXISTS (requires 9.5)', action='store_true', default=False)
parser.add_argument('--osm2pgsql', help='Include indexes normally built by osm2pgsql', action='store_true', default=False)
parser.add_argument('--reindex', help='Rebuild existing indexes', action='store_true', default=False)
parser.add_argument('--zero', '-0', help='Emit zero-separated index statements for use with xargs', action='store_true', default=False)
parser.add_argument('--null', '-0', help='SQL statements are terminated by a null character instead of whitespace for use with xargs', action='store_true', default=False)
args = parser.parse_args()

separator = '\0' if args.zero else '\n'
separator = '\0' if args.null else '\n'

def index_statement(table, name, function, conditions=None, concurrent=False,notexist=False, fillfactor=None):
options = ' CONCURRENTLY' if concurrent else ''
Expand Down

0 comments on commit ed23089

Please sign in to comment.