Skip to content

Commit 269bb75

Browse files
committed
cli: respect optional CLI archive flag.
It always called setArchived(), even when --archive was not supplied. On flashless targets such as the TI-83, that made otherwise valid conversions fail.
1 parent f520844 commit 269bb75

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

cli/cli.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ int main(int argc, char** argv)
303303
file.setContentFromString(str.str(), contentOptions);
304304
}
305305

306-
file.setArchived(result["archive"].as<bool>());
306+
if (result.count("archive"))
307+
{
308+
file.setArchived(result["archive"].as<bool>());
309+
}
307310

308311
switch (oformat)
309312
{

scripts/cli_smoke_tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ printf '\x00\x80\x10\x00\x00\x00\x00\x00\x00' > "$TMP_DIR/one_real_raw.bin"
1111
"$CLI" -i "$TMP_DIR/one_real_raw.bin" -j raw -o "$TMP_DIR/one_real.8xn" -k varfile -t Real -n A
1212
"$CLI" -i "$TMP_DIR/one_real.8xn" -j varfile -o "$TMP_DIR/one_real_roundtrip.bin" -k raw
1313
cmp -s "$TMP_DIR/one_real_raw.bin" "$TMP_DIR/one_real_roundtrip.bin"
14+
15+
printf '1' > "$TMP_DIR/one_real.txt"
16+
"$CLI" -i "$TMP_DIR/one_real.txt" -j readable -o "$TMP_DIR/one_real_83.83n" -k varfile -t Real -m 83 -n A

0 commit comments

Comments
 (0)