Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with indents in ini files #104

Closed
fawzibr opened this issue Oct 26, 2024 · 4 comments
Closed

Problems with indents in ini files #104

fawzibr opened this issue Oct 26, 2024 · 4 comments

Comments

@fawzibr
Copy link

fawzibr commented Oct 26, 2024

I'm dealing with an INI with indented keys, for example:

[section 1]
 key1=value1

If I try to add a new key with crudini --set test1.ini key2 value2 i get the following:

Source contains parsing errors: '<???>'
        [line  3]:  key1=value1

Also if the section is indented I get other problems, for example:

[section 1]
key1=value1

 [section 2]
key1=value1
key2 = value2

If I add a key to [section one] with crudini --set test2.ini "section 1" "key2" "value2" I end up with the following:

[section 1]
key1=value1

 [section 2]
key1=value1
key2 = value2

I guess it ignores [section 2] and adds it to the end. Also crudini --get test2.ini only lists [section 1]. I think it should get sections/keys even if indented. Don't know if it's a crudini problem or iniparse problem though.

@pixelb
Copy link
Owner

pixelb commented Oct 26, 2024

Can you try with the --ini-options=ignoreindent option

@fawzibr
Copy link
Author

fawzibr commented Oct 26, 2024

It just gives me the help screen so i guess it's an error, the help screen only mentions the 'nospace' option. Btw I'm testing on latest ubuntu but will use on docker (alpine).

@pixelb
Copy link
Owner

pixelb commented Oct 27, 2024

You could try downloading the latest from github and using the script directly.

@pixelb pixelb closed this as completed Oct 27, 2024
@fawzibr
Copy link
Author

fawzibr commented Oct 27, 2024

You could try downloading the latest from github and using the script directly.

Downloading latest and using --ini-options=ignoreindent works. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants