
rule all: 
    input:
        "levelthree.txt",
        "independent.txt",
        expand("test{num}.final", num=[1, 2])

rule levelone:
    output: "levelone.txt"
    shell: "touch {output}"

rule leveltwo_first:
    input: rules.levelone.output
    output: "leveltwo_first.txt"   
    shell: "cp -f {input} {output}"

rule leveltwo_second:
    input: rules.levelone.output
    output: "leveltwo_second.txt"
    shell: "cp -f {input} {output}"

rule levelthree: # should not be created
    input: 
        rules.leveltwo_first.output, 
        rules.leveltwo_second.output
    output: "levelthree.txt"
    shell: "cat {input} > {output}"

rule independent: # should be created in --omit-from but not --until
    output: "independent.txt"
    shell: "touch {output}"

###### Wildcard Rules #######

rule zeroth_wildcard:
    output: "test{num}.txt"
    shell: "touch {output}"

rule first_wildcard:
    input: 'test{num}.txt'
    output: 'test{num}.first'
    shell: 'cp -f {input} {output}'

rule second_wildcard:
    input: 'test{num}.first'
    output: 'test{num}.second'
    shell: 'cp -f {input} {output}'

rule final_wildcard:
    input: 'test{num}.second'
    output: 'test{num}.final'
    shell: 'cp -f {input} {output}'


