apenwarr-redo/redo/cmd_sources.py

21 lines
523 B
Python
Raw Normal View History

"""redo-sources: list the known source (not target) files."""
import sys, os
from . import env, logs, state
def main():
if len(sys.argv[1:]) != 0:
sys.stderr.write('%s: no arguments expected.\n' % sys.argv[0])
sys.exit(1)
state.init([])
logs.setup(tty=sys.stderr, pretty=env.v.PRETTY, color=env.v.COLOR)
cwd = os.getcwd()
for f in state.files():
if f.is_source():
print state.relpath(os.path.join(env.v.BASE, f.name), cwd)
if __name__ == '__main__':
main()