You can specify which reads should be used for demultiplexing in RunInfo.xml, which may be more convenient than --use-bases-mask. I had a run with i7 (first index, Read#2) and i5 (second index, Read#3) but I only wanted to use i7 for demultiplexing.
Make a backup copy of RunInfo.xml, which is in the run folder with the SampleSheet etc.
Open RunInfo.xml and change the following:
<Read Number="3" NumCycles="8" IsIndexedRead="Y"/>
to
<Read Number="3" NumCycles="8" IsIndexedRead="N"/>
Update SampleSheet.csv so it has only one barcode column
Run bcl2fastq as you normally would
The output was demultiplexed by i7 (first index, Read#2) and contained fastq files for three reads:
…_R1_…fastq.gz for Read#1
…_R2_…fastq.gz for i5 (second index, Read#3) that I didn't want to use for indexing
…_R3_…fastq.gz for Read#4 (it was a paired-end run)