Comments (2)
This looks like it would need to be a separate parser, possibly reusing the INI parser with some pre-processing to remove inline comments. The INI parser documentation states that all comments must be on their own line.
from jc.
Thanks, I'd missed the fact that the existing parser doesn't allow inline comments, I'll use sed
for now:
cat /etc/postgresql/15/main/postgresql.conf | sed 's/[#].*$//' | jc --ini -p
{
"data_directory": "/var/lib/postgresql/15/main",
"hba_file": "/etc/postgresql/15/main/pg_hba.conf",
"ident_file": "/etc/postgresql/15/main/pg_ident.conf",
"external_pid_file": "/var/run/postgresql/15-main.pid",
"port": "5432",
"max_connections": "100",
"unix_socket_directories": "/var/run/postgresql",
"ssl": "on",
"ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem",
"ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key",
"shared_buffers": "128MB",
"dynamic_shared_memory_type": "posix",
"max_wal_size": "1GB",
"min_wal_size": "80MB",
"log_line_prefix": "%m [%p] %q%u@%d ",
"log_timezone": "Etc/UTC",
"cluster_name": "15/main",
"datestyle": "iso, dmy",
"timezone": "Etc/UTC",
"lc_messages": "en_GB.UTF-8",
"lc_monetary": "en_GB.UTF-8",
"lc_numeric": "en_GB.UTF-8",
"lc_time": "en_GB.UTF-8",
"default_text_search_config": "pg_catalog.english",
"include_dir": "conf.d"
}
from jc.
Related Issues (20)
- [parsers /pci_ids.py] Only last [subvendor][subdevice] got loaded into result when multiple subdevices having the same subvendor id HOT 3
- Bug: Traceroute ignored IPs when multiple IPs on hop HOT 3
- "ss" Parser not working correctly: Entries Missing HOT 5
- .netrc support HOT 1
- Problem with --pip-show parser for a module with nothing on the License: line but which has following lines HOT 4
- lspci strips trailing digit on bus ID HOT 3
- `--zpool-status` fails to handle the `spares` section of `zpool status` HOT 3
- New parser request: pacman -Si HOT 9
- 1.25.3: pytest fails in nits which are comparing time HOT 8
- Python 3.12 test regression: `tests.test_ip_address.MyTests.test_ip_address_ipv6_6to4` HOT 11
- Parsing mounts with spaces in filenames fails - AttributeError: 'NoneType' object has no attribute 'groupdict' HOT 2
- New Streaming-parser proposal: traceroute-s HOT 2
- ethtool parsing doesn't work HOT 2
- Netstat issue with spaces in program name HOT 4
- jc ls --time-style=+"%F %T" -al -> wrong output HOT 1
- New Parser: cloudformation template.yaml HOT 4
- ifconfig parser of IPv4 do not support utun interfaces on macOS HOT 2
- Python 3.13 test failure: `test_ip_address_ipv6_ipv4_mapped` HOT 6
- uptime parser with 0 user(s) on ubuntu 24.04 docker not matching HOT 2
- exiftool support? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jc.